<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>zxxhouse: src/com/zxx/sql/DataBaseHelper.java源文件</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">zxxhouse
   &#160;<span id="projectnumber">1.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- 制作者 Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">src/com/zxx/sql/DataBaseHelper.java</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="keyword">package </span>com.zxx.sql;
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="keyword">import</span> java.util.ArrayList;
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="keyword">import</span> com.zxx.common.Common;
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="keyword">import</span> android.content.ContentValues;
<a name="l00008"></a>00008 <span class="keyword">import</span> android.content.Context;
<a name="l00009"></a>00009 <span class="keyword">import</span> android.database.Cursor;
<a name="l00010"></a>00010 <span class="keyword">import</span> android.database.sqlite.SQLiteDatabase;
<a name="l00011"></a>00011 <span class="keyword">import</span> android.database.sqlite.SQLiteDatabase.CursorFactory;
<a name="l00012"></a>00012 <span class="keyword">import</span> android.database.sqlite.SQLiteOpenHelper;
<a name="l00013"></a>00013 <span class="keyword">import</span> android.view.View;
<a name="l00014"></a>00014 <span class="keyword">import</span> android.view.View.OnClickListener;
<a name="l00015"></a>00015 
<a name="l00021"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html">00021</a> <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html" title="直接操作数据库类，sqlman调用该类">DataBaseHelper</a> <span class="keyword">extends</span> SQLiteOpenHelper {
<a name="l00022"></a>00022 
<a name="l00023"></a>00023         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String DB_NAME                                      = <span class="stringliteral">&quot;zxxhouseDb.sqlite&quot;</span>;
<a name="l00024"></a>00024         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String TABLE_ZXXHOUSE                       = <span class="stringliteral">&quot;zxxhouse&quot;</span>;
<a name="l00025"></a>00025         
<a name="l00026"></a>00026         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> <span class="keywordtype">int</span> VERSION = 1;<span class="comment">//第一版数据库版本号，以后每次改动都要相应增加</span>
<a name="l00027"></a>00027         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_ID                  = <span class="stringliteral">&quot;id&quot;</span>;
<a name="l00028"></a>00028         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_TITLE               = <span class="stringliteral">&quot;title&quot;</span>;
<a name="l00029"></a>00029         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_DEPAPTMENT  = <span class="stringliteral">&quot;departMent&quot;</span>;
<a name="l00030"></a>00030         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_ADDRESS     = <span class="stringliteral">&quot;address&quot;</span>;
<a name="l00031"></a>00031         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_TOTALORICE = <span class="stringliteral">&quot;totalprice&quot;</span>;
<a name="l00032"></a>00032         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_PMPRICE     = <span class="stringliteral">&quot;pmPrice&quot;</span>;
<a name="l00033"></a>00033         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_ORIENTATION = <span class="stringliteral">&quot;orientation&quot;</span>;
<a name="l00034"></a>00034         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_HOUSETYPE   = <span class="stringliteral">&quot;houseType&quot;</span>;
<a name="l00035"></a>00035         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_DECORATE    = <span class="stringliteral">&quot;decorate&quot;</span>;
<a name="l00036"></a>00036         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_AREA            = <span class="stringliteral">&quot;area&quot;</span>;
<a name="l00037"></a>00037         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_BUILDTYPE   = <span class="stringliteral">&quot;buildType&quot;</span>;
<a name="l00038"></a>00038         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_LOUCHEN     = <span class="stringliteral">&quot;louchen&quot;</span>;
<a name="l00039"></a>00039         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_BUILDAGE     = <span class="stringliteral">&quot;buildAge&quot;</span>;
<a name="l00040"></a>00040         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_PICPATH1     = <span class="stringliteral">&quot;picPath1&quot;</span>;
<a name="l00041"></a>00041         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_PICPATH2     = <span class="stringliteral">&quot;picPath2&quot;</span>;
<a name="l00042"></a>00042         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_PICPATH3     = <span class="stringliteral">&quot;picPath3&quot;</span>;
<a name="l00043"></a>00043         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_PICPATH4     = <span class="stringliteral">&quot;picPath4&quot;</span>;
<a name="l00044"></a>00044         <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String COLUMN_ZXXHOUSE_PICPATH5     = <span class="stringliteral">&quot;picPath5&quot;</span>;
<a name="l00045"></a>00045                         
<a name="l00046"></a>00046         <span class="keyword">public</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html" title="直接操作数据库类，sqlman调用该类">DataBaseHelper</a>(Context context) {
<a name="l00047"></a>00047                 super(context, DB_NAME, null, VERSION);
<a name="l00048"></a>00048                 <span class="comment">// TODO Auto-generated constructor stub</span>
<a name="l00049"></a>00049         }
<a name="l00050"></a>00050 
<a name="l00054"></a>00054         @Override
<a name="l00055"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a483a17681020106c4c5446ae3659ca58">00055</a>         <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a483a17681020106c4c5446ae3659ca58" title="建立数据表">onCreate</a>(SQLiteDatabase db) {
<a name="l00056"></a>00056                  <span class="comment">// create the &quot;zxxhouse&quot; table</span>
<a name="l00057"></a>00057                 db.execSQL(<span class="stringliteral">&quot;DROP TABLE IF EXISTS zxxhouse&quot;</span>);  
<a name="l00058"></a>00058         db.execSQL(<span class="stringliteral">&quot;CREATE TABLE zxxhouse (id INTEGER PRIMARY KEY, title VARCHAR(50),departMent VARCHAR(50),&quot;</span>+
<a name="l00059"></a>00059                  <span class="stringliteral">&quot;address VARCHAR(50),totalprice INTEGER NOT NULL DEFAULT 0,pmPrice INTEGER NOT NULL DEFAULT 0,orientation VARCHAR(50),&quot;</span>+
<a name="l00060"></a>00060                         <span class="stringliteral">&quot;houseType VARCHAR(50),decorate VARCHAR(50),area INTEGER NOT NULL DEFAULT 0,buildType VARCHAR(50),louchen VARCHAR(50),&quot;</span>+
<a name="l00061"></a>00061                  <span class="stringliteral">&quot;buildAge INTEGER NOT NULL DEFAULT 0,picPath1 VARCHAR(50),picPath2 VARCHAR(50),picPath3 VARCHAR(50),picPath4 VARCHAR(50),picPath5 VARCHAR(50))&quot;</span>);
<a name="l00062"></a>00062         }
<a name="l00063"></a>00063         
<a name="l00067"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a142d88439400d7dcff3ca070cd0fca54">00067</a>         <span class="keyword">public</span> <span class="keywordtype">long</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a142d88439400d7dcff3ca070cd0fca54" title="建立数据表">insertData</a>(<a class="code" href="classcom_1_1zxx_1_1sql_1_1house_data.html" title="搜房数据信息类">houseData</a> data) {
<a name="l00068"></a>00068                 <span class="comment">//第一种方式:使用android的插入方法</span>
<a name="l00069"></a>00069                 ContentValues cv = <span class="keyword">new</span> ContentValues();
<a name="l00070"></a>00070                 cv.put(COLUMN_ZXXHOUSE_TITLE, data.getMtitle());
<a name="l00071"></a>00071                 cv.put(COLUMN_ZXXHOUSE_DEPAPTMENT, data.getMdepartMentName());
<a name="l00072"></a>00072                 cv.put(COLUMN_ZXXHOUSE_ADDRESS, data.getMaddress());
<a name="l00073"></a>00073                 cv.put(COLUMN_ZXXHOUSE_TOTALORICE, data.getMtotalprice());
<a name="l00074"></a>00074                 cv.put(COLUMN_ZXXHOUSE_PMPRICE, data.getMpmPrice());
<a name="l00075"></a>00075                 cv.put(COLUMN_ZXXHOUSE_ORIENTATION, data.getMorientation());
<a name="l00076"></a>00076                 cv.put(COLUMN_ZXXHOUSE_HOUSETYPE, data.getMhouseType());
<a name="l00077"></a>00077                 cv.put(COLUMN_ZXXHOUSE_DECORATE, data.getMdecorate());
<a name="l00078"></a>00078                 
<a name="l00079"></a>00079                 cv.put(COLUMN_ZXXHOUSE_AREA, data.getMarea());
<a name="l00080"></a>00080                 cv.put(COLUMN_ZXXHOUSE_BUILDTYPE, data.getMbuildType());
<a name="l00081"></a>00081                 cv.put(COLUMN_ZXXHOUSE_LOUCHEN, data.getMlouchen());
<a name="l00082"></a>00082 
<a name="l00083"></a>00083                 cv.put(COLUMN_ZXXHOUSE_BUILDAGE, data.getMbuildAge());
<a name="l00084"></a>00084                 cv.put(COLUMN_ZXXHOUSE_PICPATH1, data.getMpicPath1());
<a name="l00085"></a>00085                 cv.put(COLUMN_ZXXHOUSE_PICPATH2, data.getMpicPath2());
<a name="l00086"></a>00086                 cv.put(COLUMN_ZXXHOUSE_PICPATH3, data.getMpicPath3());
<a name="l00087"></a>00087                 cv.put(COLUMN_ZXXHOUSE_PICPATH4, data.getMpicPath4());
<a name="l00088"></a>00088                 cv.put(COLUMN_ZXXHOUSE_PICPATH5, data.getMpicPath5());
<a name="l00089"></a>00089                 
<a name="l00090"></a>00090         <span class="keywordflow">return</span> getWritableDatabase().insert(TABLE_ZXXHOUSE, null, cv);
<a name="l00091"></a>00091         <span class="comment">//第2种方式:直接使用拼接sql语句</span>
<a name="l00092"></a>00092         <span class="comment">//db.execSQL(&quot;INSERT INTO zxxhouse values(null,?,?),new String[] {....}&quot;)</span>
<a name="l00093"></a>00093         
<a name="l00094"></a>00094         }
<a name="l00095"></a>00095 
<a name="l00096"></a>00096         @Override
<a name="l00097"></a>00097         <span class="keyword">public</span> <span class="keywordtype">void</span> onUpgrade(SQLiteDatabase db, <span class="keywordtype">int</span> oldVersion, <span class="keywordtype">int</span> newVersion) {
<a name="l00098"></a>00098                 <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00099"></a>00099 
<a name="l00100"></a>00100         }
<a name="l00101"></a>00101         
<a name="l00105"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a1ba2df090cac74b2a3281f0df8d8b6ce">00105</a>         <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a1ba2df090cac74b2a3281f0df8d8b6ce" title="按小区选择">select_byDepart</a>(String departMent,<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00106"></a>00106                 <span class="keywordflow">if</span>(null == departMent)
<a name="l00107"></a>00107                 {
<a name="l00108"></a>00108                         <span class="keywordflow">return</span> sort_byIDL_H(limitindex,limitnum);
<a name="l00109"></a>00109                 }
<a name="l00110"></a>00110                 
<a name="l00111"></a>00111                 String [] agrs = <span class="keyword">new</span> String[]{departMent,String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00112"></a>00112                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where departMent=? order by id asc limit ?,?&quot;</span>,agrs);   
<a name="l00113"></a>00113         }
<a name="l00120"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a4d00facfe50abf683dc52b21f777a067">00120</a>                 <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a4d00facfe50abf683dc52b21f777a067" title="选取数据库中总价在100Ｗ下的房子">select_byTotalPricebelow100W</a>(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00121"></a>00121                         String args[] = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00122"></a>00122                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where totalprice &lt;= 100 order by totalprice asc limit ?,?&quot;</span>,args);
<a name="l00123"></a>00123         }
<a name="l00130"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a738880bd8d0083701bbbd655af857b3c">00130</a>         <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a738880bd8d0083701bbbd655af857b3c" title="选取数据库中总价在200Ｗ上的房子">select_byTotalPriceabove200W</a>(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00131"></a>00131                 String args[] = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00132"></a>00132                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where totalprice &gt;= 200 order by totalprice asc limit ?,?&quot;</span>,args);
<a name="l00133"></a>00133         }
<a name="l00141"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#aac7ea38dc71810971006c13cc3af3f90">00141</a>         <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#aac7ea38dc71810971006c13cc3af3f90" title="选取数据库中总价在100Ｗ——200W之间的房子">select_byTotalPricebetween100_200</a>(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00142"></a>00142                 String args[] = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00143"></a>00143                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where totalprice &gt; 100 and  totalprice &lt; 200 order by totalprice asc limit ?,?&quot;</span>,args);
<a name="l00144"></a>00144         }
<a name="l00145"></a>00145         
<a name="l00146"></a>00146         <span class="comment">//</span>
<a name="l00147"></a>00147         <span class="keyword">public</span> ArrayList&lt;houseData&gt; select_byHouseType(String room,<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00148"></a>00148                 String sqlTextArr[] = <span class="keyword">new</span> String[]{room+<span class="stringliteral">&quot;%&quot;</span>,String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00149"></a>00149                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where houseType like ? order by id asc limit ?,?&quot;</span>,sqlTextArr);
<a name="l00150"></a>00150         }
<a name="l00151"></a>00151         
<a name="l00152"></a>00152         <span class="keyword">public</span> ArrayList&lt;houseData&gt; select_byzx(String zxText,<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00153"></a>00153                 String sqlTextArr[] = <span class="keyword">new</span> String[]{zxText,String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00154"></a>00154                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where decorate = ? order by id asc limit ?,?&quot;</span>,sqlTextArr);
<a name="l00155"></a>00155         }
<a name="l00163"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a5a7ecb58ce31d571efa6232cdff0332a">00163</a>                 <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a5a7ecb58ce31d571efa6232cdff0332a" title="选取数据库中单价小于1W的房子">select_byPmPricebelow1W</a>(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00164"></a>00164                         String sqlTextArr[] = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00165"></a>00165                         <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where pmPrice &lt;= 10000 order by pmPrice asc limit ?,?&quot;</span>,sqlTextArr);
<a name="l00166"></a>00166                 }
<a name="l00174"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ae337350f3219c2a9a30488389cb30a07">00174</a>                 <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ae337350f3219c2a9a30488389cb30a07" title="选取数据库中单价在2Ｗ上的房子">select_byPmPriceabove2W</a>(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00175"></a>00175                         String sqlTextArr[] = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00176"></a>00176                         <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where pmPrice &gt;= 20000 order by pmPrice asc  limit ?,?&quot;</span>,sqlTextArr);
<a name="l00177"></a>00177                 }
<a name="l00185"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a9a3df95a83eba8230a03bfcd91d62620">00185</a>                 <span class="keyword">public</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a9a3df95a83eba8230a03bfcd91d62620" title="选取数据库中单价在1Ｗ——2W之间的房子">select_byPricebetween1w_2w</a>(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00186"></a>00186                         String sqlTextArr[] = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00187"></a>00187                         <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse where pmPrice &gt; 10000 and  totalprice &lt; 20000 order by pmPrice asc  limit ?,?&quot;</span>,sqlTextArr);
<a name="l00188"></a>00188                 }
<a name="l00189"></a>00189                 
<a name="l00190"></a>00190                 
<a name="l00191"></a>00191         
<a name="l00192"></a>00192         
<a name="l00193"></a>00193         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byPriceH_L(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum) {
<a name="l00194"></a>00194         <span class="comment">//  &quot;select * from zxxhouse order by start_date asc&quot;</span>
<a name="l00195"></a>00195                 <span class="comment">/*Cursor wrapped = getReadableDatabase().query(TABLE_ZXXHOUSE, </span>
<a name="l00196"></a>00196 <span class="comment">                null, // all columns </span>
<a name="l00197"></a>00197 <span class="comment">                COLUMN_RUN_ID + &quot; = ?&quot;, // look for a run ID</span>
<a name="l00198"></a>00198 <span class="comment">                new String[]{ String.valueOf(id) }, // with this value</span>
<a name="l00199"></a>00199 <span class="comment">                null, // group by</span>
<a name="l00200"></a>00200 <span class="comment">                null, // order by</span>
<a name="l00201"></a>00201 <span class="comment">                null, // having</span>
<a name="l00202"></a>00202 <span class="comment">                &quot;1&quot;); // limit 1 row</span>
<a name="l00203"></a>00203 <span class="comment">        return new RunCursor(wrapped);*/</span>
<a name="l00204"></a>00204                 String [] args = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00205"></a>00205                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by pmPrice desc limit ?,?&quot;</span>,args);
<a name="l00206"></a>00206     }
<a name="l00207"></a>00207         
<a name="l00208"></a>00208         
<a name="l00209"></a>00209 
<a name="l00210"></a>00210         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byPriceL_H(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum)
<a name="l00211"></a>00211         {
<a name="l00212"></a>00212                 String [] args = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00213"></a>00213                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by pmPrice asc limit ?,?&quot;</span>,args);
<a name="l00214"></a>00214         }
<a name="l00215"></a>00215         
<a name="l00216"></a>00216         
<a name="l00217"></a>00217         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byYearH_L(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum)
<a name="l00218"></a>00218         {
<a name="l00219"></a>00219                 String [] args = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00220"></a>00220                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by buildAge desc limit ?,?&quot;</span>,args);
<a name="l00221"></a>00221         }
<a name="l00222"></a>00222                         
<a name="l00223"></a>00223         
<a name="l00224"></a>00224         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byYearL_H(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum)
<a name="l00225"></a>00225         {
<a name="l00226"></a>00226                 String [] args = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00227"></a>00227                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by buildAge asc limit ?,?&quot;</span>,args);
<a name="l00228"></a>00228         }
<a name="l00229"></a>00229                 
<a name="l00230"></a>00230         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byIDL_H(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum)
<a name="l00231"></a>00231         {
<a name="l00232"></a>00232                 String [] agrs = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00233"></a>00233                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by id asc limit ?,?&quot;</span>,agrs);
<a name="l00234"></a>00234         }
<a name="l00235"></a>00235         
<a name="l00236"></a>00236         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byAreaH_L(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum)
<a name="l00237"></a>00237         {
<a name="l00238"></a>00238                 String [] args = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00239"></a>00239                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by area desc limit ?,?&quot;</span>,args);
<a name="l00240"></a>00240         }
<a name="l00241"></a>00241         
<a name="l00242"></a>00242         <span class="keyword">public</span> ArrayList&lt;houseData&gt; sort_byAreaL_H(<span class="keywordtype">int</span> limitindex,<span class="keywordtype">int</span> limitnum)
<a name="l00243"></a>00243         {
<a name="l00244"></a>00244                 String [] args = <span class="keyword">new</span> String[]{String.valueOf(limitindex),String.valueOf(limitnum)};
<a name="l00245"></a>00245                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(<span class="stringliteral">&quot;select * from zxxhouse order by area asc limit ?,?&quot;</span>,args);
<a name="l00246"></a>00246         }
<a name="l00247"></a>00247         
<a name="l00254"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1">00254</a>         <span class="keyword">private</span> ArrayList&lt;houseData&gt; <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a244e424a6144e30e6fb02544ac12fef1" title="获取数据库按sql语句拼接后查询结果">selectSQL</a>(String sqlquery,String[] args) {
<a name="l00255"></a>00255                 
<a name="l00256"></a>00256                 ArrayList&lt;houseData&gt; list = <span class="keyword">new</span> ArrayList&lt;houseData&gt;();
<a name="l00257"></a>00257                 Cursor cursor = getReadableDatabase().rawQuery(sqlquery,args);
<a name="l00258"></a>00258                 <span class="keywordflow">while</span>(cursor.moveToNext()) {
<a name="l00259"></a>00259                         <a class="code" href="classcom_1_1zxx_1_1sql_1_1house_data.html" title="搜房数据信息类">houseData</a> data = <span class="keyword">new</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1house_data.html" title="搜房数据信息类">houseData</a>();
<a name="l00260"></a>00260                         data.setMid(cursor.getInt(cursor.getColumnIndex(COLUMN_ZXXHOUSE_ID)));
<a name="l00261"></a>00261                         data.setMtitle(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_TITLE)));
<a name="l00262"></a>00262                         data.setMdepartMentName(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_DEPAPTMENT)));
<a name="l00263"></a>00263                         data.setMaddress(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_ADDRESS)));
<a name="l00264"></a>00264                         data.setMtotalprice(cursor.getInt(cursor.getColumnIndex(COLUMN_ZXXHOUSE_TOTALORICE)));
<a name="l00265"></a>00265                         data.setMpmPrice(cursor.getInt(cursor.getColumnIndex(COLUMN_ZXXHOUSE_PMPRICE)));
<a name="l00266"></a>00266                         data.setMorientation(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_ORIENTATION)));
<a name="l00267"></a>00267                         data.setMhouseType(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_HOUSETYPE)));
<a name="l00268"></a>00268                         data.setMdecorate(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_DECORATE)));
<a name="l00269"></a>00269                         data.setMarea(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_AREA)));
<a name="l00270"></a>00270                         data.setMbuildType(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_BUILDTYPE)));
<a name="l00271"></a>00271                         data.setMlouchen(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_LOUCHEN)));
<a name="l00272"></a>00272                         data.setMbuildAge(cursor.getInt(cursor.getColumnIndex(COLUMN_ZXXHOUSE_BUILDAGE)));
<a name="l00273"></a>00273                         data.setMpicPath1(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_PICPATH1)));
<a name="l00274"></a>00274                         data.setMpicPath2(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_PICPATH2)));
<a name="l00275"></a>00275                         data.setMpicPath3(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_PICPATH3)));
<a name="l00276"></a>00276                         data.setMpicPath4(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_PICPATH4)));
<a name="l00277"></a>00277                         data.setMpicPath5(cursor.getString(cursor.getColumnIndex(COLUMN_ZXXHOUSE_PICPATH5)));
<a name="l00278"></a>00278                         list.add(data); 
<a name="l00279"></a>00279                 }       
<a name="l00280"></a>00280                 <span class="keywordflow">return</span> list;
<a name="l00281"></a>00281                 
<a name="l00282"></a>00282         }
<a name="l00283"></a>00283         
<a name="l00289"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a64cc784e2906df5e67508069246f91c7">00289</a>         <span class="keyword">public</span> <span class="keywordtype">boolean</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a64cc784e2906df5e67508069246f91c7" title="查询数据库是不是有重复数据">selectRepeatData</a>(<a class="code" href="classcom_1_1zxx_1_1sql_1_1house_data.html" title="搜房数据信息类">houseData</a> data)
<a name="l00290"></a>00290         {
<a name="l00291"></a>00291                 String [] agrs = <span class="keyword">new</span> String[]{data.getMtitle(),data.getMdepartMentName(),data.getMaddress()};
<a name="l00292"></a>00292                 Cursor cursor = getReadableDatabase().rawQuery(<span class="stringliteral">&quot;select * from zxxhouse where title = ? and departMent=? and address=?&quot;</span>,agrs);
<a name="l00293"></a>00293                 <span class="keywordflow">if</span>(0 &lt; cursor.getCount()) {
<a name="l00294"></a>00294                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00295"></a>00295                 }
<a name="l00296"></a>00296                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00297"></a>00297         }
<a name="l00298"></a>00298         
<a name="l00303"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac07978f4e7858ba1fdc4ee3cf70b38c1">00303</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac07978f4e7858ba1fdc4ee3cf70b38c1" title="获取列表剩余项目">getSortListRest</a>(){
<a name="l00304"></a>00304                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse order by id asc&quot;</span>,null);
<a name="l00305"></a>00305         }
<a name="l00306"></a>00306         
<a name="l00312"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a4ad07dffcd6eafdcd227136f6d1bf6d8">00312</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a4ad07dffcd6eafdcd227136f6d1bf6d8" title="获取区域剩余项目">getDepartmentRest</a>(String [] args){
<a name="l00313"></a>00313                 
<a name="l00314"></a>00314                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where departMent = ? order by id asc&quot;</span>,args);
<a name="l00315"></a>00315         }
<a name="l00320"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a8c36701e1a6550ae6e9c9fd212118cd2">00320</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a8c36701e1a6550ae6e9c9fd212118cd2" title="获取总价格剩余项目(小于100W)">getTotalPricebelow100W</a>(){
<a name="l00321"></a>00321                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where totalprice  &lt;= 100 order by totalprice asc&quot;</span>,null);
<a name="l00322"></a>00322         }
<a name="l00327"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a1a573af5e5dc2e3da464db8306ac202f">00327</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a1a573af5e5dc2e3da464db8306ac202f" title="获取总价格剩余项目(100W_200W之间)">getTotalPrice100W_200W</a>(){
<a name="l00328"></a>00328                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where totalprice &gt; 100 and totalprice &lt; 200 order by totalprice asc&quot;</span>,null);
<a name="l00329"></a>00329         }
<a name="l00334"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac8d51264dab4db042d6fc81f31b7a67b">00334</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac8d51264dab4db042d6fc81f31b7a67b" title="获取总价格剩余项目(大于200Ｗ)">getTotalPriceabove200W</a>(){
<a name="l00335"></a>00335                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where totalprice &gt;= 200 order by totalprice asc&quot;</span>,null);
<a name="l00336"></a>00336         }
<a name="l00337"></a>00337         
<a name="l00344"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a97a296a026ae1dffff131cdf5e3b5575">00344</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a97a296a026ae1dffff131cdf5e3b5575" title="获取按房子类型的剩余屋子总数">getHouseTypeRest</a>(String[] args){
<a name="l00345"></a>00345                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where houseType like ? order by id asc&quot;</span>,args);
<a name="l00346"></a>00346                 
<a name="l00347"></a>00347         }
<a name="l00348"></a>00348         
<a name="l00354"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a09d0383cf37d1e8b86acb34b447e97b4">00354</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a09d0383cf37d1e8b86acb34b447e97b4" title="获取按装修类型的房子剩余总数">getZXTypeRest</a>(String[] args){
<a name="l00355"></a>00355                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where decorate = ? order by id asc&quot;</span>,args);
<a name="l00356"></a>00356         }
<a name="l00357"></a>00357         
<a name="l00362"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a8049b88898ba4ac2d5f419cd3acf3e92">00362</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a8049b88898ba4ac2d5f419cd3acf3e92" title="获取单价剩余项目(小于1W)">getPmPriceBELOW1W</a>(){
<a name="l00363"></a>00363                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where pmPrice  &lt;= 10000 order by pmPrice asc&quot;</span>,null);
<a name="l00364"></a>00364         }
<a name="l00369"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ad9f82a031e22b1c73f1ee42bf39aa803">00369</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ad9f82a031e22b1c73f1ee42bf39aa803" title="获取单价剩余项目(1W_2W之间)">getPmPrice1W_2W</a>(){
<a name="l00370"></a>00370                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where pmPrice &gt; 10000 and pmPrice &lt; 20000 order by pmPrice asc&quot;</span>,null);
<a name="l00371"></a>00371         }
<a name="l00376"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a83b37eb5a06585c21f6343622bcb19ed">00376</a>         <span class="keyword">public</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#a83b37eb5a06585c21f6343622bcb19ed" title="获取单价剩余项目(大于2Ｗ)">getPmPriceabove2W</a>(){
<a name="l00377"></a>00377                 <span class="keywordflow">return</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(<span class="stringliteral">&quot;select count(*) from zxxhouse where pmPrice &gt;= 20000 order by pmPrice asc&quot;</span>,null);
<a name="l00378"></a>00378         }
<a name="l00379"></a>00379         
<a name="l00387"></a><a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43">00387</a>         <span class="keyword">private</span> <span class="keywordtype">int</span> <a class="code" href="classcom_1_1zxx_1_1sql_1_1_data_base_helper.html#ac5fa833c7831d807f81ac6044ccfeb43" title="获取数据库按sql语句拼接后查询的总列数">getSQLCount</a>(String sqlquery,String[] args) {
<a name="l00388"></a>00388                 <span class="keywordtype">int</span>  num=0;
<a name="l00389"></a>00389                 Cursor cursor = getReadableDatabase().rawQuery(sqlquery,args);
<a name="l00390"></a>00390                 <span class="keywordflow">while</span>(cursor.moveToNext()) {
<a name="l00391"></a>00391                         num += cursor.getInt(0);
<a name="l00392"></a>00392                 }
<a name="l00393"></a>00393                 <span class="keywordflow">return</span> num;
<a name="l00394"></a>00394                 
<a name="l00395"></a>00395         }
<a name="l00396"></a>00396                 
<a name="l00397"></a>00397         
<a name="l00398"></a>00398                 
<a name="l00399"></a>00399 }
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated at 2015年二月4日 星期三 18:11:09 for zxxhouse by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
